import logging,yagmail

def log_set():
    logging.basicConfig(filename='log.txt',filemode='w+',level=logging.DEBUG,format='%(message)s ->  %(levelname)s -> %(filename)s')

def send_mail(filepath):
       mail =yagmail.SMTP(user='2539722579@qq.com',password='uncucoutvhxrdicg',host='smtp.qq.com')
       mail.send(to='2539722579@qq.com',subject="测试报告",contents="今日报告请查看",attachments=filepath)